package com.honglang.module.user.action;

import com.honglang.module.user.entity.User;
import com.honglang.module.user.service.UserService;
import com.honglang.struts2.action.BaseAction;
import com.opensymphony.xwork2.Action;

public class ForgetPasswordAction extends BaseAction{
	
	private UserService userService;
	
	
	public String reSendPassword(){
		String username = this.getRequest().getParameter("username");
		String email = this.getRequest().getParameter("email");
		User user = this.getUserService().getUserByNameAndEmail(username, email);
		if(null != user){
			this.getRequest().setAttribute("feedMessage", this.getUserService().sendPassword(user));
		}else{
			this.getRequest().setAttribute("feedMessage", "inValide");
		}		
		return Action.SUCCESS;
	}

	
	
	
	
	
	
	

	
	public UserService getUserService() {
		return userService;
	}


	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	
}
